package com.vcredit.creditcat.framework.pagination;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * 分页查询条件缺省实现
 * 
 *
 */
public class DefaultCriteria implements Criteria,Serializable {

	private static final long serialVersionUID = -5977316213726418953L;
	/**
	 * 
	 */
	private Map<String, Object> params = new HashMap<String,Object>();
	public DefaultCriteria(long start,long limit){
		params.put("start", start);
		params.put("limit", limit);
	}
	public DefaultCriteria(){
		super();
	}
	@Override
	public String toString() {
		Set<String> keySet = this.params.keySet();
		StringBuilder sb = new StringBuilder();
		
		for (String key : keySet) {
			sb.append(key).append("=").append(this.params.get(key)).append(";");
		}
		
		return sb.toString();
	}
	public Map<String, Object> getParams() {
		return params;
	}
	public void setParams(Map<String, Object> params) {
		this.params = params;
	}
	public String getParam(String key){
		return (String) this.params.get(key);
	}
}
